package cn.neusoft.pojo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/*
t_cart表中的每一条记录就是一个购车项
    cartId   foodId  businessId   userId  quantity
       1       1         1          1        2
             胡辣汤    白家胡辣汤     张三       2
       2       2         1          1        1
             油饼     白家胡辣汤     张三        1
 */
@Data
@NoArgsConstructor
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CartItem{

    private Integer cartId;
    private Integer foodId;
    private Integer businessId;
    private Integer userId;
    private Integer quantity;

    private Food food;
    private Business business;
    private User user;

    public CartItem(Integer cartId, Integer foodId, Integer businessId, Integer userId, Integer quantity) {
        this.cartId = cartId;
        this.foodId = foodId;
        this.businessId = businessId;
        this.userId = userId;
        this.quantity = quantity;
    }
}
